Multi-versioning in Transactional Memory
نویسندگان
چکیده
Reducing the number of aborts is one of the biggest challenges of most transactional systems: existing TMs may abort many transactions that could, in fact, commit without violating correctness. Historically, the commonly used method for reducing the abort rate was maintaining multiple object versions. Multiversion concurrency control is a classical approach for providing concurrent access to the database in database management systems. Its idea is to let a reading transaction obtain a consistent snapshot corresponding to an arbitrary point in time (e.g., defined at the beginning of a transaction) – concurrent updates are isolated through maintaining old versions rather than via scheduling decisions. Multi-versioning was adopted by transactional memory algorithms as well. In this chapter we overview the multi-versioning approach by studying the inherent properties of STMs that use multiple versions to guarantee successful commits of all read-only transactions. We first consider the challenges of garbage collecting of old object versions, and show that no STM can be optimal in the number of previous versions kept, while following the naı̈ve approach of keeping a constant number of last versions per object might lead to an exponential memory growth. We then show the potential performance challenges of multi-versioned STMs, including disjoint-access parallelism and visibility of read-only transactions. We demonstrate the advantages of implementing multi-versioned STMs in managed memory environments by presenting Selective Multi-Versioning (SMV) algorithm. SMV relies on automatic garbage collection, and thus efficiently deals with old versions while still allowing invisible read-only transactions. 1 Why Multiple Versions 1.1 Because Read-Only Transactions Matter Frequent aborts, especially in the presence of long-running transactions, may have a devastating effect on performance and predictability of the execution [3,11,18]. Of particular interest in this context is reducing the abort rate of read-only transactions (transactions with empty write-sets). Read-only transactions play a significant role in various types of applications, including linearizable data structures with a strong prevalence of read-only operations [19], or client-server applications where an STM infrastructure replaces a traditional DBMS approach (e.g., FenixEDU web application [8]). Particularly long read-only transactions are employed for taking consistent snapshots of dynamically updated systems, which are then used for checkpointing, process replication, monitoring program execution, gathering system statistics, etc. R. Guerraoui and P. Romano (Eds.): Transactional Memory, LNCS 8913, pp. 150–165, 2015. c © Springer International Publishing Switzerland 2015 Multi-versioning in Transactional Memory 151 Unfortunately, long read-only transactions might be repeatedly aborted for arbitrarily long periods of time. As we show in [26], the time for completing such a transaction varies significantly under contention, to the point that some read-only transactions simply cannot be executed without “stopping the world”. This kind of instability becomes a practical disadvantage for STM adoption in the real-world systems. Historically, one of the commonly used methods for reducing the number of aborts was maintaining multiple object versions. Multiversion concurrency control is a classical approach for providing concurrent access to the database in database management systems [6,25]. Its idea is to let a reading transaction obtain a consistent snapshot [5] corresponding to an arbitrary point in time (typically defined at the beginning of a transaction) – concurrent updates are isolated through maintaining old versions rather than through a process of locks or mutexes. Multi-versioning technique was adopted by transactional memory algorithms as well [3,24,14,7,26]. By keeping multiple versions it is possible to ensure that every read-only transaction successfully commits. Consider, for example, the scenario depicted in Figure 1. 1 In this run transaction T2 reads an object o1, then another transaction T3 updates objects o1 and o2, and commits. Assume that T2 now tries to read o2. Reading the value o2 written by T3 would violate correctness, since T2 does not read the value o2 written by T3. In a single-versioned STM, illustrated in Figure 1(a), T2 must abort. However, a multi-versioned STM may keep both versions o2 and o 2 2 of o2, and may return o2 to T2, as illustrated in Figure 1(b). This allows T2 to successfully commit, in spite of its conflict with T3.
منابع مشابه
Serializability of Transactions in Software Transactional Memory
The use of two-phase locking (2PL) to enforce serialization in today’s Software Transactional Memory (STM) systems leads to poor performance for programs with long-running transactions and considerable data sharing. We propose the use of ConflictSerializability (CS) instead of 2PL. The use of CS allows transactions to complete when they would have either stalled or aborted with 2PL, potentially...
متن کاملFramework Support for the Efficient Implementation of Multi-version Algorithms
Software Transactional Memory algorithms associate metadata with the memory locations accessed during a transaction’s lifetime. This metadata may be stored in an external table and accessed by way of a function that maps the address of each memory location with the table entry that keeps its metadata (this is the out-place or external scheme); or alternatively may be stored adjacent to the asso...
متن کاملConcurrent Video: Versioning Concepts
Concurrent video is a recently proposed data model especially intended for collaborative authoring environments. Based on cooperative transactional mechanisms, it provides a solid foundation for consistent sharing and exchange of information in multi-user editing systems. The goal of this work is to extend the already presented model with versioning capabilities by utilizing major transactional...
متن کاملLV*: A low complexity lazy versioning HTM infrastructure
Transactional memory (TM) promises to unlock parallelism in software in a safer and easier way than lock-based approaches but the path to deployment is unclear for several reasons. First of all, since TM has not been deployed in any machine yet, experience of using it is limited. While software transactional memory implementations exist, they are too slow to provide useful experience. Existing ...
متن کاملHardware Transactions in Nonvolatile Memory
Hardware transactional memory (HTM) implementations already provide a transactional abstraction at HW speed in multi-core systems. The imminent availability of mature byte-addressable, nonvolatile memory (NVM) will provide persistence at the speed of accessing main memory. This paper presents the notion of persistent HTM (PHTM), which combines HTM and NVM and features hardware-assisted, lockfre...
متن کامل